package server.controller;

import l1j.server.server.model.L1World;
import l1j.server.server.model.Instance.L1PcInstance;

public class SpeedHackController extends Thread {
	private static SpeedHackController _instance;

	public static SpeedHackController getInstance() {
		if (_instance == null) {
			_instance = new SpeedHackController();
			_instance.start();
		}
		return _instance;
	}

	public void hack_timer() {
		try {
			for (L1PcInstance pc : L1World.getInstance().getAllPlayers()) {
				if (pc == null || pc.getNetConnection() == null
						|| pc.isPrivateShop())
					continue;
				else
					pc.increase_hackTimer();
			}
		} catch (Exception e) {
		}
	}

	public void run() {
		do {
			try {
				hack_timer();
				// speedHackEngine_timer();
				sleep(1000);
			} catch (Exception e) {
			}
		} while (true);
	}

}
